import request from '@/utils/request'

export default{
  //分页查询
  getHospSetList(current,limit,searchObj){
    return request({
        url: `/admin/hosp/hospitalSet/findPage/${current}/${limit}`,//使用模板字符串传递方法的参数
        method: 'post',
        data: searchObj //使用JSON格式传输的数据
      })
  },

  //根据id删除
  removeById(id) {
    return request({
        url: `/admin/hosp/hospitalSet/${id}`,
        method: 'delete'
    })
},

  //新增医院
  save(hospset) {
    return request({
        url: `/admin/hosp/hospitalSet/saveHospitalSet`,
        method: 'post',
        data: hospset
    })
  },

  //批量删除医院
  removeRows(idList) {
    return request({
        url: `/admin/hosp/hospitalSet/batchRemove`,
        method: 'delete',
        data: idList //requestBoday使用json进行数据传递 payload
    })
},
  //根据id查询数据
  getById(id){
    return request({
        url: `/admin/hosp/hospitalSet/getHospSet/${id}`,
        method:'get'
    })
  },

  updateById(hospset){
    return request({
        url:`/admin/hosp/hospitalSet/updateHospitalSet`,
        method:'post',
        data: hospset
    })
},
//锁定和取消锁定
lockHospSet(id,status) {
  return request ({
    url: `/admin/hosp/hospitalSet/lockHospitalSet/${id}/${status}`,
    method: 'put'
  })
}
}